#ifdef GL_ES
precision mediump float;
#endif

uniform vec2 u_resolution;
uniform float u_time;
float random(vec2 st) {
    return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);
}

void main() {
    vec2 vUv = gl_FragCoord.xy / u_resolution;
    // vec2 st = vUv * 10.0;
    // gl_FragColor.rgb = vec3(random(st));
    // gl_FragColor.rgb = vec3(random(floor(st)));

    vec2 st = vUv * vec2(100.0, 50.0);

    st.x -= (1.0 + 10.0 * random(vec2(floor(st.y)))) * u_time;

    vec2 ipos = floor(st);
    vec2 fpos = fract(st);

    vec3 color = vec3(step(random(ipos), 0.7));
    color *= step(0.2, fpos.y);

    gl_FragColor.rgb = color;

    gl_FragColor.a = 1.;
}